load("@ros2//:ros_py.bzl", "ros_py_test")
load(
    "//tools/skylark:drake_ros_cc.bzl",
    "drake_ros_cc_relink_as_shared_library",
)

# Static library roll-up.
cc_library(
    name = "drake_ros",
    visibility = ["//visibility:public"],
    deps = [
        "//core",
        "//tf2",
        "//viz",
    ],
)

# Shared library recompilation and roll-up.
drake_ros_cc_relink_as_shared_library(
    name = "drake_ros_shared_library",
    deps_to_relink = [
        "//core",
        "//tf2",
        "//viz",
    ],
    include_prefix = "drake_ros/",
    visibility = ["//visibility:public"],
    deps = [
        "//core:odr_safe_deps",
        "//tf2:odr_safe_deps",
        "//viz:odr_safe_deps",
        "@drake//:drake_shared_library",
    ],
)

py_library(
    name = "drake_ros_py",
    visibility = ["//visibility:public"],
    deps = [
        "//drake_ros:drake_ros_py",
    ],
)

ros_py_test(
    name = "import_test",
    srcs = ["test/import_test.py"],
    main = "test/import_test.py",
    deps = [":drake_ros_py"],
)
